package com.ita.processor;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Scanner;

import util.FileHelper;

public class ServerProcessor {

	public void processScp(InputStream in, OutputStream out, String cmd) throws IOException {
		System.out.println("in control process");
		Scanner scanner = new Scanner(in);
		String fileName = "file\\" + cmd.substring(cmd.indexOf("/") + 1, cmd.length()) + 1;
		out.write(("do you sure to upload ? y/n\r\n").getBytes());
		String yString = scanner.nextLine();
		if (yString.equals("y")) {
//			FileHelper.write(fileName, in);
			out.write("upload success".getBytes());
		} else {
			out.write("you choose not to unload".getBytes());
		}
	}

}
